package cc.wsyw126.java.nowcoder.offer360.interview;

import java.util.HashMap;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/4/11.
 */
public class Main {
    public static void main(String[] args) {
        int a[] = {9, -1, 19, 22, -2, 33};
        int max = Integer.MIN_VALUE;
        int min =a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] - min > max) {
                max = a[i] -min;
            }
           if (a[i] < min) {
               min = a[i];
           }
        }
        System.out.println(max);

    }
}
